package com.inputstream;


import java.io.*;

/**
 * Version: 1.1
 * Author: TangJun
 * Date: 2024-07-28
 */
public class ObjectIn {
    public static void main(String[] args) throws IOException {
        //创建
        String fileParent = "D:\\CScode\\code\\java_code\\2024\\t0728\\src\\com";
        File fileName = new File(fileParent, "object.haha");
        ObjectInputStream fileIn = new ObjectInputStream(new FileInputStream(fileName));

        //读取
        System.out.println(fileIn.readInt());
        System.out.println(fileIn.readUTF());
        try {
            System.out.println(fileIn.readObject());
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
        PrintStream out = new PrintStream(System.out);
    }
}
